from django.db import models
from django.contrib.auth.models import User
     
class UserPermisos(models.Model):
    list_select_related=True
    user = models.ForeignKey(User, unique=True)
    admin = models.BooleanField()
    supervisor = models.BooleanField()
    experto= models.BooleanField()
    
    def is_admin(self):
        return self.admin
    
    def is_supervisor(self):
        return self.supervisor
    
    def  is_experto(self):
        return self.experto
        
        
class Solicitudes(models.Model):
    list_select_related=True
    user = models.ForeignKey(User)
    admin = models.BooleanField()
    supervisor = models.BooleanField()
    experto= models.BooleanField()
    
    def solicitud_admin(self):
        return self.admin
    
    def solicitud_supervisor(self):
        return self.supervisor
    
    def  solicitud_experto(self):
        return self.experto